<div class="control-group js_scene_style js_b2pics hide">
	<label class="control-label">多图展示：</label>
	<div class="controls">
        <div class="span12" style="margin-bottom:10px">
			<a href="javascript:void(0)" class="btn" id="add_menu2"><i class="icon-plus"></i>添加图片</a>
		</div>
		<table class="table table-bordered table-hover dataTable">
			<thead>
				<tr>
					<th>缩略图</th>
					<th>图片地址</th>
					<th class="norightborder">操作</th>
				</tr>
			</thead>
			<tbody id="listTable2">
				{if empty($data['thumbs'])}
					<tr class="copy_rows2">
						<td>
                            <div id="map_image_uploads" style="width:330px;">
                                {php echo tpl_form_field_image('b2pics[nails][]', $data['mthumb'])}
                            </div>
                            <div class="help-inline">（建议尺寸:宽250像素,高350像素或等比图片）</div>
                        </td>
						<td>
                            <div id="map_image_uploads" style="width:330px;">
                                {php echo tpl_form_field_image('b2pics[thumbs][]', $data['mthumb'])}
                            </div>
                            <div class="help-inline">（建议尺寸:宽400像素,高700像素或等比图片）</div>
                        </td>
						<td><a href="javascript:;" class="del">删除</a></td>
					</tr>
				{else}	
					{loop $data['thumbs'] $key $row} 
					<tr class="copy_rows2">
					<td>
						{if isset($data['nails'][$key])}
                        <div id="map_image_uploads" style="width:330px;">
                            {php echo tpl_form_field_image('b2pics[nails][]', $data['nails'][$key])}
                        </div>
                        <div class="help-inline">（建议尺寸:宽400像素,高700像素或等比图片）</div>
						{else}
                        <div id="map_image_uploads" style="width:330px;">
                            {php echo tpl_form_field_image('b2pics[nails][]', $data['nails'][$key])}
                        </div>
                        <div class="help-inline">（建议尺寸:宽250像素,高350像素或等比图片）</div>
						{/if}
					</td>
					<td>
                        <div id="map_image_uploads" style="width:330px;">
                            {php echo tpl_form_field_image('b2pics[thumbs][]', $row)}
                        </div>
					</td>
					<td><a href="javascript:;" class="del">删除</a></td>
					</tr>
					{/loop}
				{/if}
			</tbody>
		</table>
		<span class="help-block">大图小图必须配对上传，否则会出错</span>
	</div>
</div>
<script>
//页面事件监听
		$(document).ready(function(){
			 
			//新增门店实景
			$("#add_menu2").click(function(){
				$('.copy_rows2:first').clone(true).appendTo('#listTable2').find('input[type=text]').val('');
				$('.copy_rows2:last').find('img').attr({src:'',alt:'',title:''});
 			});
			
			//删除门店实景
			$("#listTable2 .del").click(function () {
					var removeObj = $(this).parent('td').parent('tr');
					var className = removeObj.attr('class');
					if($("." + className).length <= 1){
						removeObj.find('img').attr("src","");
						return removeObj.find('input[type=text],input[type=hidden]').val('');
						
					}
					return removeObj.remove();
				
			});
		});
</script>